package day2.demo1;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Emp implements Comparable<Emp>{
    int num;//随机值
    int power;//权重


    @Override
    public int compareTo(Emp o) {
        if(power-o.power==0){
            return num-o.num;
        }
        return power-o.power;
    }
}
